package com.pizza.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Hashtable;

import com.pizza.abstrait.*;

/**
 * Class Pizza, entite du modele.
 *
 */
public class Pizza extends AbstractPizza implements Serializable {

	public Pizza(int id, String nom, String description, String url_image, boolean personnalisee, AbstractClient clientPizzaPerso) {
		this.id = id;
		this.nom = nom;
		this.description = description;
		this.url_image = url_image;
		this.personnalisee = personnalisee;
		this.clientPizzaPerso = clientPizzaPerso;
		diametres = new ArrayList<AbstractPizzaDiametre>();
		ingredients = new ArrayList<Ingredient>();
		entrySet = new ArrayList();
	}
	
	public Pizza(String nom, String description, String url_image, AbstractClient clientPizzaPerso, ArrayList<AbstractPizzaDiametre> diametres, ArrayList<Ingredient> ingredients) {
		this.nom = nom;
		this.description = description;
		this.url_image = url_image;
		this.personnalisee = true;
		this.clientPizzaPerso = clientPizzaPerso;
		this.diametres = diametres;
		this.ingredients = ingredients ;
	}
	
	public Pizza(AbstractPizza _pizza, AbstractClient _client)
	{
		this.nom = "Pizza Perso";
		this.description = "Pizza personnalisée";
		this.url_image =  "Perso_light.png";
		this.personnalisee = true;
		this.clientPizzaPerso = _client;
		this.ingredients = new ArrayList<Ingredient>();
		for(int i=0; i< _pizza.getIngredients().size(); i++){
			this.ingredients.add(_pizza.getIngredients().get(i));
		}
				
		diametres = new ArrayList<AbstractPizzaDiametre>();
		diametres.add(new AbstractPizzaDiametre(_pizza.getDiametres().get(0).getDiametre(), 11f));
		diametres.add(new AbstractPizzaDiametre(_pizza.getDiametres().get(1).getDiametre(), 13.5f));
		diametres.add(new AbstractPizzaDiametre(_pizza.getDiametres().get(2).getDiametre(), 15f));
		
	}
}
